package com.edu.service;

import com.edu.entiy.Book;
import com.edu.entiy.Page;
import com.edu.entiy.User;
import com.edu.utils.PageTool;

public interface BookService {
	//分页查询
	Page<Book> selectByPage(int currentPage,int pageSize);
	//分页查询
	PageTool<Book> page(String currentPage,String pageSize);
	//带条件的分页查询
	Page<Book> selectByPage(Book book,int currentPage,int pageSize);
	//根据图书名称查找图书
	Book selectBookByName(String bookName);
	//添加图书
	int addBook(Book book);
	//修改图书
	int updateBook(Book book);
	//删除图书
	int deleteBook(int bookId);
	//借阅图书
	boolean borrowBook(User user,int bookId);
	//根据id查找图书
	Book selectBookById(int bookId);
	//分页查询(带搜索)
	PageTool<Book> page(String currentPage, String pageSize,String word);
	//根据书的借出次数倒序排列
	PageTool<Book> selectBooksOrderByTimesDesc(String currentPage,String pageSize);
	//根据书籍类型id查询
	Book selectByCard(int card);
}
